package com.ouyang.mapper;

import com.ouyang.mapper.po.MonitorPoolPO;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * @author Huawei
 */
@Mapper
public interface MonitorPoolMapper {

    @Insert("insert into monitor_pool (mp_id,machine_id,machine_code,model_id,monitor_type,monitor_photo,remark,community_id,create_time)" +
            "values(#{mpId},#{machineId},#{machineCode},#{modelId},#{monitorType},#{monitorPhoto},#{remark},#{communityId},now())")
    void addMonitorPool(MonitorPoolPO monitorPoolPO);

    @Select("select machine_id from monitor_machine where machine_code=#{machineCode}")
    String queryMachineIdByMachineCode(@Param("machineCode")String machineCode);
}
